<template>
  <view class="map">
    <web-view src="/hybrid/html/ljgh.html"
      @onPostMessage="handlePostMessage"
      @message="handlePostMessage"
      :webview-styles="webviewStyles">
    </web-view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      webviewStyles: { // web-view样式
        width: "95%",
        height: 200,
        top: 150,
        left: '2.5%'
      },
    }
  },
  methods: {
    //获取天地图参数
    handlePostMessage(data) {
      console.log(data.detail.data[0], '天地图发来的数据')
    },

  }
}
</script>

<style scoped lang="scss">
.map {
  overflow: hidden;
  position: relative;
  height: 80vh;
}
</style>
